﻿using Entity;
using IRealize;
using Microsoft.AspNetCore.Mvc;
using Realize;

namespace WebApplication9.Controllers.Recruit_Manage.LY
{
    public class ER_LYCXController : Controller
    {
        private readonly IConfiguration configuration;

        public ER_LYCXController(IConfiguration configuration)
        {
            this.configuration = configuration;
        }
        public IActionResult Index()
        {
            return View();
        }

        public async Task<IActionResult> Select_LY(int CurrentPage, int PageSize)
        {
            IER eR = new ER();
            List<Engage_Resume> zhi = await eR.Select_LyCx(configuration["SqlServer"]);
            List<Engage_Resume> zhi2 = zhi.Skip((CurrentPage - 1) * PageSize).Take(PageSize).ToList();
            PagedViewModel<Engage_Resume> cc = new PagedViewModel<Engage_Resume>() { itemas = zhi2, total = zhi.Count };
            return Ok(new
            {
                list = cc
            });
        }

        public IActionResult Upd(string id)
        {
            ViewBag.TitleId = id;
            return View();
        }
    }
}
